home *** CD-ROM | disk | FTP | other *** search
/ Kit PC World De Ampliacion De Windows 95 / Kit PC World de ampliacion de Windows 95.iso / internet / sweeper / samples / olecon~1 / include / ipserver.h < prev    next >
Text File  |  1995-11-25  |  2KB  |  70 lines

  1. //=--------------------------------------------------------------------------=
  2. // InProcServer.H
  3. //=--------------------------------------------------------------------------=
  4. // Copyright  1995  Microsoft Corporation.  All Rights Reserved.
  5. //
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 
  7. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 
  8. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 
  9. // PARTICULAR PURPOSE.
  10. //=--------------------------------------------------------------------------=
  11. //
  12. // global header file that contains all the windows stuff, etc ...  should
  13. // be pre-compiled to speed things up a little bit.
  14. //
  15. #ifndef _INPROCSERVER_H_
  16.  
  17. #define INC_OLE2
  18. #include <windows.h>
  19. #include <stddef.h>                    // for offsetof()
  20. #include <olectl.h>
  21.  
  22.  
  23.  
  24.  
  25. // things that -everybody- wants [read: is going to get]
  26. //
  27. #include "Debug.H"
  28.  
  29. //=--------------------------------------------------------------------------=
  30. // we don't want to use the CRTs, and would like some memory tracking in the
  31. // debug case, so we'll override these guys
  32. //=--------------------------------------------------------------------------=
  33. //
  34. void * _cdecl operator new(size_t size);
  35. void  _cdecl operator delete(void *ptr);
  36.  
  37.  
  38. //=--------------------------------------------------------------------------=
  39. // Useful macros
  40. //=--------------------------------------------------------------------------=
  41. //
  42. // handy error macros, randing from cleaning up, to returning to clearing
  43. // rich error information as well.
  44. //
  45. #define RETURN_ON_FAILURE(hr) if (FAILED(hr)) return hr
  46. #define RETURN_ON_NULLALLOC(ptr) if (!(ptr)) return E_OUTOFMEMORY
  47. #define CLEANUP_ON_FAILURE(hr) if (FAILED(hr)) goto CleanUp
  48. #define CLEARERRORINFORET(hr) { SetErrorInfo(0, NULL); return hr; }
  49. #define CLEARERRORINFORET_ON_FAILURE(hr) if (FAILED(hr)) { SetErrorInfo(0, NULL); return hr; }
  50.  
  51. #define CLEANUP_ON_ERROR(l)    if (l != ERROR_SUCCESS) goto CleanUp
  52.  
  53. // conversions
  54. //
  55. #define BOOL_TO_VARIANTBOOL(f) (f) ? VARIANT_TRUE : VARIANT_FALSE
  56.  
  57. // for optimizing QI's
  58. //
  59. #define DO_GUIDS_MATCH(riid1, riid2) ((riid1.Data1 == riid2.Data1) && (riid1 == riid2))
  60.  
  61. // Reference counting help.
  62. //
  63. #define RELEASE_OBJECT(ptr)    if (ptr) { IUnknown *pUnk = (ptr); (ptr) = NULL; pUnk->Release(); }
  64. #define ADDREF_OBJECT(ptr)     if (ptr) (ptr)->AddRef()
  65.  
  66.  
  67. #define _INPROCSERVER_H_
  68. #endif // _INPROCSERVER_H_
  69.  
  70.